package socket.client1;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.net.Socket;

/**
 * @author zss
 * @date 2021/8/31 11:01
 * @Email:451682479@qq.com
 */
public class Client1Main {

    public static void main(String[] args) throws IOException {

        Socket socket = new Socket("127.0.0.1", 9999);

        String str = "天将午，饥肠响如鼓；林中封锁已三日，囊中存米清可数，野菜和水煮。";

        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));

        writer.write(str);

        System.out.println("client send msg ");

        writer.flush();

        socket.shutdownOutput();

    }
}
